<?php

require_once 'Core/Db/Table/Abstract.php';
require_once 'Core/Db/Table/Row/Abstract.php';
require_once 'Core/Db/Table/Rowset/Abstract.php';

class Nld_Models_Pdf_Page_DbTable extends Core_Db_Table_Abstract
{
	public function init()
	{
		$this->_name 						= 'pdf_page';
		$this->_primary 				= 'id';
		$this->_rowClass 				= 'Core_Db_Table_Row_Abstract';
		$this->_rowsetClass 		= 'Core_Db_Table_Rowset_Abstract';
		
		$this->_dependentTables = array(
			'Number' 		=> Nld_Models::getTableClass('Pdf/Number'),
			'Entry' 		=> Nld_Models::getTableClass('Pdf/Entry'),
		);

		$this->_referenceMap 	= array(
			array(
				'columns'           => 'number',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Number'),
				'refColumns'        => 'id'
			),
			array(
				'columns'           => 'id',
				'refTableClass'     => Nld_Models::getTableClass('Pdf/Entry'),
				'refColumns'        => 'page',
			),
    );
	}
	public function getStatus($index = null)
  {
		$list = array('Ngừng kích hoạt', 'Kích hoạt');
    return ($index === null)?$list:@$list[intval($index)];
  }
}